package core;

import java.io.*;
import java.net.*;
public class OneInstance{
	Socket s;
  public boolean checkOneInstance() {
	  boolean suc = true;
	  try{
          ServerSocket s = new ServerSocket(5555);
          //System.out.println("port "+i+" can be used.");
          //s.close();
          suc = true;
     }catch(IOException e){
         if(e instanceof java.net.BindException) {
             System.out.println(" aready in use.");
             suc = false;
         }else {
             System.err.println(" other error..");
             suc = false;
         }
     }
	return suc;
  }
}

